package com.buobao.lambda;

import java.util.function.Consumer;

/**
 * consumer接口示例
 * 有一个输入参数但是不能有输出
 */
public class ConsumerSample {
    public static void main(String[] args) {
        output(s->System.out.println(s));
        output(s->{
            s = s.toUpperCase();
            System.out.println(s);
        });
    }

    public static void output(Consumer<String> consumer) {
        String text = "be upper people,you need down get";
        consumer.accept(text);
    }
}
